import { PSControlContainerImpl } from '../pscontrol-container-impl';
import { IPSTabExpPage } from './ipstab-exp-page';
import { IPSTabExpPanel } from './ipstab-exp-panel';

export class PSTabExpPanelImpl extends PSControlContainerImpl implements IPSTabExpPanel {
  protected pstabexppages: IPSTabExpPage[] | null = null;

  getPSTabExpPages(): IPSTabExpPage[] | null {
    if (this.pstabexppages == null) {
      this.pstabexppages = this.fillChildListModel(this.M.getPSTabExpPages, 'control.expbar.IPSTabExpPage') as IPSTabExpPage[];
    }
    return this.pstabexppages;
  }

  get psTabExpPages(): IPSTabExpPage[] | null {
    return this.getPSTabExpPages();
  }

  findPSTabExpPage(objKey: any): IPSTabExpPage | null {
    return this.getPSModel5('control.expbar.IPSTabExpPage', this.getPSTabExpPages(), objKey) as IPSTabExpPage;
  }

  get tabLayout(): 'TOP' | 'TOP_EMBEDDED' | 'LEFT' | 'BOTTOM' | 'RIGHT' | 'FLOW' | 'FLOW_NOHEADER' | 'NOHAEDER' | 'USER' | 'USER2' {
    return this.M.tabLayout;
  }

  get uniqueTag(): string {
    return this.M.uniqueTag;
  }

  get cls(): string {
    return 'PSTabExpPanelImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.IPSControl' || cls == 'control.expbar.IPSTabExpPanel') return true;
    return super.instanceof(cls);
  }
}
